<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
</style>
<script type="text/javascript">
function openWin(f, n, w, h, s) 
{
	//sb = s == "1" ? "1" : "0";
	//l = (screen.width - w) / 2;
	//t = (screen.height - h) / 2;
	//sFeatures = "left=" + l + ",top=" + t + ",height=" + h + ",width=" + w
			//+ ",center=1,scrollbars=" + sb
			//+ ",status=0,directories=0,channelmode=0";
	//openwin = window.open(f, n, sFeatures);
	//if (!openwin.opener)
		//openwin.opener = self;
	//openwin.focus();
	//return openwin;
    var result=window.open(f,n,"dialogHeight:"+h+";dialogWidth:"+w+";"+s);
    if(result==true)
    {
    	window.location.reload(true);
    }
    else
    {
    	//window.location.reload(true);
    }
    
}

	        function myXinxi()
	        {
	            
	            
	         <c:if test="${user==null }"  var="flag" scope="session">
	                var url="<%=path %>/qiantai/userinfo/userXinxi.jsp";
	                var n="";
	                var w="480px";
	                var h="500px";
	                var s="resizable:no;help:no;status:no;scroll:yes";
				    openWin(url,n,w,h,s);
	           	</c:if>
	        }
	        function myCart()
	        {
	            <c:if test="${user==null }"  var="flag" scope="session">
	                  alert("请先登录");
	          	</c:if>
	            
	             <c:if test="${not flag}">
	                 var s="<%=path %>/myCart.action";
	                 window.location.href=s;
	             </c:if>
	        }
	        
	        function myOrder()
	        {
	          <c:if test="${user==null }"  var="flag" scope="session">
	                  alert("请先登录");
	          	</c:if>
	            
	          <c:if test="${not flag}">
	                 var s="<%=path %>/myOrder.action";
	                 window.location.href=s;
	           </c:if>
	        }
	        
	        function liuyanAll()
	        {
	          <c:if test="${user==null }"  var="flag" scope="session">
	                  alert("请先登录");
	          	</c:if>
	            
	           <c:if test="${not flag}">
	                 var url="<%=path %>/liuyanAll.action";
				     window.open(url,"_blank");
	            </c:if>
	        }
	        function reg()
	        {
	                var url="<%=path %>/qiantai/userinfo/userReg.jsp";
	                var n="";
	                var w="480px";
	                var h="500px";
	                var s="resizable:no;help:no;status:no;scroll:yes";
				    openWin(url,n,w,h,s);
	        }
      </script>

</script>
</head>

<body>
	<nav class="navbar navbar-inverse">
	<div class="container-fluid">
		<!-- Brand and toggle get grouped for better mobile display -->
		<div class="navbar-header">
			<button type="button" class="navbar-toggle collapsed"
				data-toggle="collapse" data-target="#bs-example-navbar-collapse-9"
				aria-expanded="false">
				<span class="sr-only">Toggle navigation</span> <span
					class="icon-bar"></span> <span class="icon-bar"></span> <span
					class="icon-bar"></span>
			</button>
			<a class="navbar-brand" href="#"></a>
		</div>

		<!-- Collect the nav links, forms, and other content for toggling -->
		<div class="collapse navbar-collapse"
			id="bs-example-navbar-collapse-9">
			<ul class="nav navbar-nav">
				<li class="active"><a href="<%=path %>/qiantai/default.jsp">商城首页</a></li>
				<li><a href="#" onclick="reg()">用户注册</a></li>
				<li><a href="qiantai/userinfo/userXinxi.jsp" onclick="myXinxi()">我的信息</a></li>
				<li><a href="qiantai/myCart/myCart.jsp" onclick="myCart()">我的购物车</a></li>
				<li><a href="#" onclick="myOrder()">我的订单</a></li>
			</ul>
			<form class="navbar-form navbar-left" action="<%=path %>/goodSearch.action"
		method="post">
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<div class="form-group">
					<input type="text" class="form-control" placeholder="Search" onkeypress="if(event.keyCode==13){searchFormSubmit();return false;}"
					name="goodsName" >
				</div>
				<button type="submit" class="btn btn-default" >搜索</button>
			</form>

		</div>
	</div>
	</nav>
</body>
</html>
